#ifndef __TYPEDEF_INC___
#define	__TYPEDEF_INC___

/*
 * Company  : Datalogic S.p.A.
 * Title    : type definitions for vdisk library
 * Filename : typedef.inc
 * System   : Keil-Frankling C-Language Compiler
 * MemoryMod: large
 * Notes    :
 */

//*************************************************************************

typedef unsigned char UCHAR;
typedef unsigned int  USHORT;
typedef unsigned int  UINT;
typedef int SHORT;
typedef char CHAR;
typedef unsigned char BOOL;
typedef unsigned int  HWND;
typedef unsigned long ULONG;
typedef char * LPCSTR;
typedef unsigned char HCURSOR;
typedef unsigned char HFILE;
typedef unsigned long FILE_POINTER;

//*************************************************************************

typedef struct tabDIRECTORY
{
  UCHAR Bank;                    // bank addres used when writing
  UCHAR StartBank;               // starting bank identifier
  UINT  Address;                 // used when writing
  UINT  StartAddress;            // file start address
  ULONG Length;                  // maximum file length
  ULONG Nrecords;                // maximum record number
  UCHAR Fields;                  // maximum field number for record
  UCHAR Field_length[ 50 ];      // field length ( max. 50 fields )
  ULONG FreeLength;              // remaining length - used when writing
  ULONG FreeNrecord;             // stored records
  UCHAR FreeField;               // next field to fill - used when writing
  UCHAR CurrentBank;             // position: current bank
  UINT  CurrentAddress;          // position: current address
  UCHAR attribute;
}DIRECTORY;

//***************************************************************************

typedef struct tagINFO
{
  UCHAR name;                   /* File ID              */
  ULONG length;                 /* Max file length      */
  ULONG Nrecords;               /* Max records          */
  UCHAR Fields;                 /* Max field for record */
  UCHAR Field_length[ 20 ];     /* Field length         */
}INFO;  

//***************************************************************************

typedef struct tagUSERDIR
{
  ULONG Nrecords;               /* pointer to the record */
  ULONG Length;                 /* max file length       */
  UCHAR MaxField;               /* max field             */
  ULONG MaxRecord;              /* max record            */
  UCHAR CurField;               /* pointer to the field  */
  UINT  Address;                /* current data pointer  */
  UCHAR Bank;                   /* current bank pointer  */
}USERDIR;

//***************************************************************************

typedef struct tagREADPOS
{
  ULONG record;
  UCHAR field;
}READPOS;

#endif